import "./style.css";
import { createApp } from "vue";
import App from "./App.vue";
import useVant from "./useComponent";
import { router } from "./router";
import { createPinia } from "pinia";
import api from "@/api/index.js";
import wxShare from "@/utils/wxShare.js"; //微信操作js
console.log("import:", import.meta.env.MODE);
if (["staging", "development"].includes(import.meta.env.MODE)) {
  import("./utils/tools").then(({ eruda }) => {
    eruda();
  });
}

const app = createApp(App);
const pinia = createPinia();
app.use(pinia);
app.config.globalProperties.$api = api;
if (wxShare.isWechat()) {
  app.config.globalProperties.$wxShare = wxShare;
}
useVant(app);
app.use(router);
app.mount("#app");

export default app;
